import request from '@/utils/request'
const apiUrl = '/api/purchase-request'
// 获取申购单列表
export function getPurchaseRequestList(params) {
    return request({
        url: `${apiUrl}/list`,
        method: 'get',
        params
    })
}

// 获取申购单详情
export function getPurchaseRequestDetail(id) {
    return request({
        url: `${apiUrl}/${id}`,
        method: 'get'
    })
}

// 保存或更新申购单
export function savePurchaseRequest(data) {
    return request({
        url: `${apiUrl}/save`,
        method: 'post',
        data
    })
}

// 删除申购单
export function deletePurchaseRequest(id) {
    return request({
        url: `${apiUrl}/${id}`,
        method: 'delete'
    })
}

// 批量删除申购单
export function batchDeletePurchaseRequest(ids) {
    return request({
        url: `${apiUrl}/batch-delete`,
        method: 'post',
        data: ids
    })
} 